<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>

<body>

<form class="layui-form" lay-filter="manageForm" id="add_manage_form" action="" style="padding:15px 10px;">
    <input type="hidden" name="cmId">
    <div class="layui-form-item">
        <label class="layui-form-label">班级名称</label>
        <div class="layui-input-block">
            <input type="text" name="cmName" required  lay-verify="required" placeholder="请输入班级名称" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">班级人数</label>
        <div class="layui-input-block">
            <input type="text" name="cmNumber" required lay-verify="required" placeholder="班级人数" autocomplete="off" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">所属年级</label>
        <div class="layui-input-block" >
            <select name="gradeId" id="grade"> <!--xm-select="roles2" xm-select-direction="down"-->
                <option value="-1">请选择</option>
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">所属园所</label>
        <div class="layui-input-block" id="fuji">
            <input type="hidden" name="glId" id="glId">
            <input type="text" id="glIdName" readonly="readonly" value="asdf" class="layui-input">
        </div>
    </div>

    <script>
       /* layui.form.render();*/
        $.get("http://localhost:9999/Grade/gradeIndex",{gIId:$("#gIId").val()},function(data){
            $.each(data,function(){
                var opt = $("<option></option>").appendTo("#grade");
                opt.text(this.gradeName).val(this.gradeId);
            });
            layui.form.render();
        });

    </script>
</form>
</body>
</html>